<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<%@ include file="/web/head.jsp"%>
</head>
<body>
	<div style="width: 350px;">
		<div style="width: 350px; margin: 0 auto; padding-top: 30px;">
			<form class="layui-form" action="">
				<div class="layui-form-item">
					<label class="layui-form-label"><span style="color: red;">*</span>账号</label>
					<div class="layui-input-block">
						<input type="text" name="account" required lay-verify="required"
							placeholder="请输入账号" autocomplete="off" class="layui-input">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label"><span style="color: red;">*</span>密码</label>
					<div class="layui-input-inline">
						<input type="password" name="password" required
							lay-verify="required" placeholder="请输入密码" autocomplete="off"
							class="layui-input">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label"><span style="color: red;">*</span>确认密码</label>
					<div class="layui-input-inline">
						<input type="password" name="realPassword" required
							lay-verify="required" placeholder="请再次输入密码" autocomplete="off"
							class="layui-input">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label"><span style="color: red;">*</span>姓名</label>
					<div class="layui-input-inline">
						<input type="text" name="realName" required lay-verify="required"
							placeholder="请输入作家名" autocomplete="off" class="layui-input">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label"><span style="color: red;">*</span>笔名</label>
					<div class="layui-input-inline">
						<input type="text" name="penName" required lay-verify="required"
							placeholder="请输入作家笔名" autocomplete="off" class="layui-input">
					</div>
				</div>
				<input type="hidden" name="image" value="base.jfif">
				<div class="layui-form-item">
					<label class="layui-form-label">手机号</label>
					<div class="layui-input-inline">
						<input type="text" name="phone" placeholder="请输入手机号"
							autocomplete="off" class="layui-input">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label"><span style="color: red;">*</span>邮件</label>
					<div class="layui-input-inline">
						<input type="text" name="email" required lay-verify="required|email"
							placeholder="请填写作家邮件" autocomplete="off" class="layui-input">
					</div>
				</div>
				<div class="layui-form-item layui-form-text">
					<label class="layui-form-label">个人简介</label>
					<div class="layui-input-block">
						<textarea name="message" placeholder="请输入内容"
							class="layui-textarea"></textarea>
					</div>
				</div>
				<div class="layui-form-item">
					<div class="layui-input-block">
						<input id="sumbit" type="button" class="layui-btn" lay-submit lay-filter="add" value="立即提交">
						<input type="reset" class="layui-btn layui-btn-primary" value="重置">
					</div>
				</div>
				<input type="hidden" name="action" value="add">
			</form>
		</div>
	</div>
	<script type="text/javascript">
	
// 		添加信息操作
		formOnSubmit('add', 'text', '/WriterServlet', function(data, index) {
			if (data == 'success') {
				layer.msg("添加成功", {
					time : 1000,
					icon : 6
				}, frameClose)
			} else if(data == 'passError'){
				layer.msg("两次输入不一致", {
					time : 1000,
					icon : 5
				})
			} else {
				layer.msg("添加失败", {
					time : 1000,
					icon : 5
				})
			}
		})
		
	</script>
</body>
</html>